package com.appbee.cm.client.regionunit.ui;

import javax.inject.Inject;

import com.appbee.cm.client.regionunit.presenter.RegionActivity;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;

public class AddModulView extends Button implements RegionActivity.AddModulView
{

	private RegionActivity presenter;

	@Inject
	public AddModulView(IRegionStyle regionStyle)
	{
		setText("Add");
		setStyleName(regionStyle.addButton());
		addClickHandler(new ClickHandler()
		{

			@Override
			public void onClick(ClickEvent event)
			{
				presenter.doAdd(event.getSource());
			}
		});
	}

	@Override
	public void setPresenter(RegionActivity presenter)
	{
		this.presenter = presenter;

	}

}
